xenconsoled: use array index to keep track of pollfd
authorWei Liu <wei.liu2@citrix.com>
Tue, 19 Mar 2013 17:45:49 +0000 (17:45 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 25 Mar 2013 13:00:01 +0000 (13:00 +0000)
commit85bae8b3406b234f3074617771072623525a3576
tree8ff8c435638a188cc1941e8e1b24bcbb5e4f9d88
parentf325cdf4118a3209d4c193b9490bd5bc8f2150fb
xenconsoled: use array index to keep track of pollfd

If we use pointers to reference elements inside array, it is possible that we
get wild pointer after realloc(3) copies array and returns a new pointer.

Keep track of element indexes inside the array can solve this problem.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Marcus Granado <marcus.granado@citrix.com>
Tested-by: Marcus Granado <marcus.granado@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/console/daemon/io.c